<template>
  <div id="detail">
    <detail-nav-bar/>
    <detail-swiper :top-images="topImages"/>
  </div>
</template>

<script>
import DetailNavBar from "@/views/detail/childComps/DetailNavBar";
import DetailSwiper from "@/views/detail/childComps/DetailSwiper";
import {getDetail} from "@/network/detail";

export default {
  name: "Detail",
  data() {
    return {
      iid: null,
      topImages: []
    }
  },
  components: {
    DetailNavBar,
    DetailSwiper
  },
  created() {
    // 保存传入的ID
    this.iid = this.$route.params.id

    getDetail(this.iid).then(res => {
      console.log(res);
      this.topImages = res.data.result.itemInfo.topImages;
    })
  }
}
</script>

<style scoped>

</style>
